spec: v0.4 draft amendment — textScope, ∃-within, trigger rule re-anchor (ADR-M3-1 amendment)#13
Merged
Merged
Conversation
…-M3-1 amendment) On PR-15 evidence (dspack-gen#24: 216 runs; corrected decomposition 67 projectable-today / 20 liftable / 117 no-text-anywhere): - required-props requiredText gains textScope: self|subtree (default self; dependentRequired on requiredText); 'within' scoping is now ∃-quantified. Amendment note in §4.1 states the principle the evidence taught: a rule SHOULD state exactly the precondition of the projection it protects. - rule.trigger-carries-label re-anchored on alert-dialog-trigger with textScope subtree — 'an accessible label exists somewhere under the trigger' — matching the audited lift landing in dspack-emit. Contract 2.1.0 -> 2.2.0. - migration doc amendment note; negative fixture for bad textScope. validate + 17 negative fixtures green. Maintainer-directed amendment (2026-07-04); v0.4 is a draft — semantics freeze at release, not before. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
There was a problem hiding this comment.
Pull request overview
Updates the v0.4 draft spec, migration guide, schema, and example pack to amend required-props semantics so rules more precisely match the projection preconditions they are intended to protect (notably for trigger labeling).
Changes:
- Introduces
textScope: self | subtreeforrequiredTextand documents the draft amendment rationale in the v0.4 spec and migration guide. - Changes
withinevaluation semantics to be ∃-quantified (at least one matching descendant per scope satisfies constraints) and re-anchorsrule.trigger-carries-labeltoalert-dialog-trigger. - Updates schema validation (incl.
dependentRequired) and adds a negative fixture; bumps the shadcn example contract version and updates the rule instance.
Reviewed changes
Copilot reviewed 5 out of 5 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| spec/migration-v0.3-to-v0.4.md | Updates the migration example rule and records the draft amendment note for the re-anchored trigger-label rule. |
| spec/dspack-v0.4.md | Amends required-props documentation: adds textScope, switches within to ∃ semantics, and records the evidence-based draft amendment. |
| schema/dspack.v0.4.schema.json | Adds textScope (enum + default) and schema-level dependency to require requiredText when textScope is present. |
| fixtures/negative/rule-required-props-bad-textscope.dspack.json | Adds a negative fixture to ensure invalid textScope values are rejected by schema validation. |
| examples/shadcn-ui.dspack.json | Updates example contract version and re-anchors rule.trigger-carries-label to alert-dialog-trigger with textScope: subtree. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…aluation-unit wording - requiredText schema description no longer claims descendant text never satisfies (contradicted textScope: subtree); points at textScope. - spec §4.1 semantics reworded: constraints are ALWAYS evaluated against candidate nodes matching component, never the within node; within changes candidacy, quantification, and finding location. The two modes and the constraint definition now name their evaluation unit explicitly. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The ADR-M3-1 amendment, maintainer-directed after PR-15's decomposition (dspack-gen#24): the first live run of
required-propsshowed the rule as authored was stricter than the projection it protects — 67 of 204 violating runs had surfaces the A2UI target emits successfully (labeled bearer + textless sibling button), and 20 more carried liftable misplaced text; only 117 were irreducibly unprojectable (no label text anywhere).Changes (v0.4 is a draft; semantics freeze at release)
textScope: self | subtreeonrequiredText(defaultself, schema-enforceddependentRequired):subtreeexpresses "carries a label somewhere under it" — for compound wrappers whose documented projections lift text from within.withinis now ∃-quantified: at least one matching descendant per scope satisfies the constraints (was: every one must). The ∀ form is what flagged the textless siblings.rule.trigger-carries-labelre-anchored:alert-dialog-trigger+requiredText+textScope: subtree— stating exactly the precondition of the extended, audited lift landing in dspack-emit (companion PR). Contract → 2.2.0.Acceptance
npm run validategreen; 17/17 negative fixtures rejected (new: badtextScopevalue).Companions (sequenced, not stacked)
dspack-gen evaluator update + fixtures + findings correction note (the merged 131/73 split used a bucket definition that counted trigger-own-text as projectable-today; the emitter does not consume it — corrected numbers 67/20/117); dspack-emit audited lift; ds-mcp sync; amendment-effect rerun.
🤖 Generated with Claude Code